﻿<?php
//设置页面内容是html编码格式是utf-8
error_reporting(0);
header("Content-Type: text/html;charset=utf-8"); 
require_once '../model/PdoMySQL.class.php';
require_once '../model/config.php';
if ($_SERVER["REQUEST_METHOD"] == "GET") {
	delete();
}
function delete(){
	$id = $_GET["id"];
	
	if (!isset($_GET["id"]) || empty($_GET["id"])) {
		echo "参数错误";
		return;
	}
	
	$pdo=new PdoMySQL();
	$sql="DELETE  FROM projector WHERE id={$id}";
	$stmt=$pdo->query($sql);
	if($stmt=='1'){
		
		echo '<script language="javascript">window.alert("删除成功！"),location.href="../admin/account.php";</script>';
	}else{
		echo '<script language="JavaScript">window.location.href="../view/500.php";</script>';
	}


	
}


